home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / fm2_252b.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1997-02-03  |  50KB  |  1,258 lines

  1. /****************************************************************************
  2.  * FM/2 2.x installation program copyright (c) 1993-96 by M. Kimes          *
  3.  ****************************************************************************
  4.  *                                                                          *
  5.  * This program creates folders to hold program and data objects,           *
  6.  * then creates program objects for each executable.  It only needs to be   *
  7.  * run once (unless you move the FM/2 directory -- see say notes at end).   *
  8.  * Run this program in the FM/2 directory (where you unpacked the archive). *
  9.  *                                                                          *
  10.  ****************************************************************************
  11.  *                                                                          *
  12.  * For unattended installation, call with /UNATTENDED as the first          *
  13.  * argument.  To avoid any WPS associations being set, use the              *
  14.  * /NOASSOC argument.  INSTALL /? for usage help.                           *
  15.  *                                                                          *
  16.  ****************************************************************************/
  17.  
  18. /* Identify ourself */
  19.  
  20. '@Echo off'
  21. 'cls'
  22.  
  23. say'     ┌───────────────────────────────────────────────────────────────────┐'
  24. say'     │                  FM/2 2.x Installation Program                    │'
  25. say'     │             FM/2 is copyright (c) 1993-96 by M. Kimes             │'
  26. say'     │                       All rights reserved                         │'
  27. say'     ├───────────────────────────────────────────────────────────────────┤'
  28. say'     ├───────────────────────────────────────────────────────────────────┤'
  29. say'     │                Have you read the READ.ME file yet?                │'
  30. say'     │        By running this program, you agree to the license          │'
  31. say'     │                     as specified in that file,                    │'
  32. say'     │      and it tells you how to install, so you should read it.      │'
  33. say'     │                             Please?                               │'
  34. say'     └───────────────────────────────────────────────────────────────────┘'
  35.  
  36. assocfilter = ';ASSOCFILTER=*.ZIP,*.ARC,*.LZH,*.ARJ,*.ZOO,*.MO0,READ.ME,README,README.1ST,README.OS2,REGISTER.TXT'
  37.  
  38. /* check arguments and adjust as required */
  39.  
  40. parse upper arg dummy1 dummy2
  41. if dummy1 = '/NOASSOC' then assocfilter = ''
  42. if dummy2 = '/NOASSOC' then assocfilter = ''
  43. if assocfilter = '' then say '     /NOASSOC = TRUE'
  44.  
  45. if dummy1 = '/UNATTENDED' then unattended = ''
  46. if dummy2 = '/UNATTENDED' then unattended = ''
  47. if unattended = '' then say '     /UNATTENDED = TRUE'
  48.  
  49. /* if user asked for usage help, give it */
  50.  
  51. if dummy1 = '/?' | dummy2 = '/?' then
  52. do
  53.   say ''
  54.   say 'Usage:  INSTALL [/NOASSOC] [/UNATTENDED]'
  55.   say ' /NOASSOC    = don''t set any WPS associations'
  56.   say ' /UNATTENDED = don''t ask any questions'
  57.   say ''
  58.   say 'Examples:'
  59.   say ' INSTALL'
  60.   say ' INSTALL /NOASSOC'
  61.   say ' INSTALL /UNATTENDED'
  62.   say ' INSTALL /NOASSOC /UNATTENDED'
  63.   exit
  64. end
  65.  
  66. /* see if we might be in the right directory... */
  67.  
  68. rc = stream('fm3.exe','c','query exists')
  69. if rc = '' then
  70. do
  71.   say 'Sorry, FM3.EXE not found.  Must not be right directory.  Terminating.'
  72.   exit
  73. end
  74.  
  75. /* tell user what we're doing */
  76.  
  77. say ''
  78. say 'This program creates objects for FM/2 and does some drudgework for you.'
  79. say ''
  80.  
  81. /* load rexx utility functions */
  82.  
  83. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  84. call SysLoadFuncs
  85.  
  86. /* give user a chance to hit CTRL-C */
  87.  
  88. if unattended = 'UNATTENDED' then
  89. do
  90.   call charout ,'  Press [Enter] to continue...'
  91.   dummy = ''
  92.   do until dummy = '0d'x
  93.     dummy = SysGetKey('NOECHO')
  94.   end
  95.   call charout ,'0d1b'x'[K'
  96. end
  97.  
  98. /* save current directory */
  99.  
  100. curdir = directory()
  101.  
  102. /* say it, then do it */
  103.  
  104. say "Creating File Manager/2 folders and objects..."
  105.  
  106. /* first, create FM/2 folder */
  107.  
  108. rc = stream('fm2fldr.ico','c','query exists')
  109. title = "File Manager/2"
  110. classname = 'WPFolder'
  111. location = '<WP_DESKTOP>'
  112. setup = ''
  113. if rc \= '' then setup = 'ICONFILE='rc';'
  114. setup = setup'OBJECTID=<FM3_Folder>'
  115. result = SysCreateObject(classname,title,location,setup,f)
  116.  
  117. if unattended = 'UNATTENDED' then
  118. do
  119.   if result = 0 then
  120.   do
  121.     assocfilter = ''
  122.     existed = ''
  123.     say ''
  124.     say 'The File Manager/2 folder already exists.'
  125.     call charout ,"Should I update the objects (it's painless)? (Y/N) "
  126.     dummy = ''
  127.     do forever
  128.       dummy = SysGetKey('NOECHO')
  129.       parse upper var dummy dummy
  130.       if dummy = '1b'x then dummy = 'N'
  131.       if dummy = '0d'x then dummy = 'Y'
  132.       if dummy = 'N' then leave
  133.       if dummy = 'Y' then leave
  134.     end
  135.     call charout ,dummy
  136.     say ''
  137.     if dummy = 'N' then exit
  138.   end
  139. end
  140. else
  141. do
  142.   if result = 0 then
  143.   do
  144.     assocfilter = ''
  145.     existed = ''
  146.     say 'Updating objects.'
  147.   end
  148. end
  149.  
  150. /* create objects in appropriate folders */
  151.  
  152. rc = stream('fm3.exe','c','query exists')
  153. if rc \= '' then
  154. do
  155.   title = "FM/2"
  156.   classname = 'WPProgram'
  157.   location = '<FM3_Folder>'
  158.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  159.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  160.   setup = setup';OBJECTID=<FM/2>'
  161.   call SysCreateObject classname,title,location,setup,u
  162. end
  163.  
  164. rc = stream('fm4.exe','c','query exists')
  165. if rc \= '' then
  166. do
  167.   title = "FM/2 Lite"
  168.   classname = 'WPProgram'
  169.   location = '<FM3_Folder>'
  170.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  171.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  172.   setup = setup';OBJECTID=<FM/2 LITE>'
  173.   call SysCreateObject classname,title,location,setup,u
  174. end
  175.  
  176. /* create toolbox folder in FM/2 folder */
  177. rc = stream('toolbox.ico','c','query exists')
  178. title = "FM/2 Tools"
  179. classname = 'WPFolder'
  180. location = '<FM3_Folder>'
  181. setup = ''
  182. if rc \= '' then setup = 'ICONFILE='rc';'
  183. setup = setup'OBJECTID=<FM3_Tools>'
  184. result = SysCreateObject(classname,title,location,setup,u)
  185.  
  186. /* create documentation folder in FM/2 folder */
  187. rc = stream('docs.ico','c','query exists')
  188. title = "FM/2 Docs"
  189. classname = 'WPFolder'
  190. location = '<FM3_Folder>'
  191. setup = ''
  192. if rc \= '' then setup = 'ICONFILE='rc';'
  193. setup = setup'OBJECTID=<FM3_Docs>'
  194. result = SysCreateObject(classname,title,location,setup,u)
  195.  
  196. rc = stream('av2.exe','c','query exists')
  197. if rc \= '' then
  198. do
  199.   title = "Archive Viewer/2"
  200.   classname = 'WPProgram'
  201.   location = '<FM3_Tools>'
  202.   setup = 'EXENAME='rc';STARTUPDIR='curdir''assocfilter
  203.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  204.   setup = setup';OBJECTID=<FM/2_AV/2>'
  205.   call SysCreateObject classname,title,location,setup,u
  206. end
  207.  
  208. rc = stream('eas.exe','c','query exists')
  209. if rc \= '' then
  210. do
  211.   title = "EA Viewer"
  212.   classname = 'WPProgram'
  213.   location = '<FM3_Tools>'
  214.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  215.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  216.   setup = setup';OBJECTID=<FM/2_EAVIEW>'
  217.   call SysCreateObject classname,title,location,setup,u
  218. end
  219.  
  220. rc = stream('image.exe','c','query exists')
  221. if rc \= '' then
  222. do
  223.   title = "Image Viewer"
  224.   classname = 'WPProgram'
  225.   location = '<FM3_Tools>'
  226.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  227.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  228.   setup = setup';OBJECTID=<FM/2_IMAGEVIEW>'
  229.   call SysCreateObject classname,title,location,setup,u
  230. end
  231. else
  232. do
  233.   rc = stream('utils\image.exe','c','query exists')
  234.   if rc \= '' then
  235.   do
  236.     title = "Image Viewer"
  237.     classname = 'WPProgram'
  238.     location = '<FM3_Tools>'
  239.     setup = 'EXENAME='rc';STARTUPDIR='curdir
  240.     if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  241.     setup = setup';OBJECTID=<FM/2_IMAGEVIEW>'
  242.     call SysCreateObject classname,title,location,setup,u
  243.   end
  244. end
  245.  
  246. rc = stream('dirsize.exe','c','query exists')
  247. if rc \= '' then
  248. do
  249.   title = "Dir Sizes"
  250.   classname = 'WPProgram'
  251.   location = '<FM3_Tools>'
  252.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  253.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  254.   setup = setup';OBJECTID=<FM/2_DIRSIZE>'
  255.   call SysCreateObject classname,title,location,setup,u
  256. end
  257.  
  258. rc = stream('makearc.exe','c','query exists')
  259. if rc \= '' then
  260. do
  261.   title = "Make Archive"
  262.   classname = 'WPProgram'
  263.   location = '<FM3_Tools>'
  264.   setup = 'EXENAME='rc';STARTUPDIR='curdir
  265.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  266.   setup = setup';OBJECTID=<FM/2_MAKEARC>'
  267.   call SysCreateObject classname,title,location,setup,u
  268. end
  269.  
  270. rc = stream('ini.exe','c','query exists')
  271. if rc \= '' then
  272. do
  273.   if assocfilter \= '' then assocfilter = ';ASSOCFILTER=*.INI'
  274.   title = "INI Viewer"
  275.   classname = 'WPProgram'
  276.   location = '<FM3_Tools>'
  277.   setup = 'EXENAME='rc';STARTUPDIR='curdir''assocfilter
  278.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  279.   setup = setup';OBJECTID=<FM/2_INIVIEW>'
  280.   call SysCreateObject classname,title,location,setup,u
  281. end
  282.  
  283. rc = stream('viewinfs.exe','c','query exists')
  284. if rc \= '' then
  285. do
  286.   title = "Bookshelf Viewer"
  287.   classname = 'WPProgram'
  288.   location = '<FM3_Tools>'
  289.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_BOOKSHELF>'
  290.   call SysCreateObject classname,title,location,setup,u
  291.   title = "Helpfile Viewer"
  292.   classname = 'WPProgram'
  293.   location = '<FM3_Tools>'
  294.   setup = 'EXENAME='rc';PARAMETERS=DUMMY;STARTUPDIR='curdir
  295.   call SysCreateObject classname,title,location,setup,u
  296. end
  297.  
  298. rc = stream('killproc.exe','c','query exists')
  299. if rc \= '' then
  300. do
  301.   title = "Process Killer"
  302.   classname = 'WPProgram'
  303.   location = '<FM3_Tools>'
  304.   setup = 'EXENAME='rc';PARAMETERS=%;STARTUPDIR='curdir';OBJECTID=<FM/2_KILLPROC>'
  305.   call SysCreateObject classname,title,location,setup,u
  306. end
  307.  
  308. rc = stream('undel.exe','c','query exists')
  309. if rc \= '' then
  310. do
  311.   title = "Undeleter"
  312.   classname = 'WPProgram'
  313.   location = '<FM3_Tools>'
  314.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_UNDEL>'
  315.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  316.   call SysCreateObject classname,title,location,setup,u
  317. end
  318.  
  319. rc = stream('vtree.exe','c','query exists')
  320. if rc \= '' then
  321. do
  322.   title = "Visual Tree"
  323.   classname = 'WPProgram'
  324.   location = '<FM3_Tools>'
  325.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_VTREE>'
  326.   call SysCreateObject classname,title,location,setup,u
  327. end
  328.  
  329. rc = stream('vdir.exe','c','query exists')
  330. if rc \= '' then
  331. do
  332.   title = "Visual Directory"
  333.   classname = 'WPProgram'
  334.   location = '<FM3_Tools>'
  335.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_VDIR>'
  336.   if existed = 'EXISTED' then setup = setup';PARAMETERS=%*'
  337.   call SysCreateObject classname,title,location,setup,u
  338. end
  339.  
  340. rc = stream('vcollect.exe','c','query exists')
  341. if rc \= '' then
  342. do
  343.   title = "Collector"
  344.   classname = 'WPProgram'
  345.   location = '<FM3_Tools>'
  346.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_VCOLLECT>'
  347.   call SysCreateObject classname,title,location,setup,u
  348.   title = "Seek and scan"
  349.   classname = 'WPProgram'
  350.   location = '<FM3_Tools>'
  351.   setup = 'EXENAME='rc';PARAMETERS=**;STARTUPDIR='curdir';OBJECTID=<FM/2_VSEEK>'
  352.   call SysCreateObject classname,title,location,setup,u
  353. end
  354.  
  355. rc = stream('global.exe','c','query exists')
  356. if rc \= '' then
  357. do
  358.   title = "Global File Viewer"
  359.   classname = 'WPProgram'
  360.   location = '<FM3_Tools>'
  361.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_SEEALL>'
  362.   call SysCreateObject classname,title,location,setup,u
  363. end
  364.  
  365. rc = stream('databar.exe','c','query exists')
  366. if rc \= '' then
  367. do
  368.   title = "Databar"
  369.   classname = 'WPProgram'
  370.   location = '<FM3_Tools>'
  371.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_DATABAR>'
  372.   call SysCreateObject classname,title,location,setup,u
  373. end
  374.  
  375. rc = stream('sysinfo.exe','c','query exists')
  376. if rc \= '' then
  377. do
  378.   title = "SysInfo"
  379.   classname = 'WPProgram'
  380.   location = '<FM3_Tools>'
  381.   setup = 'EXENAME='rc';STARTUPDIR='curdir';OBJECTID=<FM/2_SYSINFO>'
  382.   call SysCreateObject classname,title,location,setup,u
  383. end
  384.  
  385. rc = stream('fm2play.exe','c','query exists')
  386. if rc \= '' then
  387. do
  388.   title = "FM2Play"
  389.   classname = 'WPProgram'
  390.   location = '<FM3_Tools>'
  391.   setup = 'EXENAME='rc';OBJECTID=<FM/2_FM2PLAY>;PARAMETERS=/! %*'
  392.   call SysCreateObject classname,title,location,setup,u
  393. end
  394. else
  395. do
  396.   rc = stream('utils\fm2play.exe','c','query exists')
  397.   if rc \= '' then
  398.   do
  399.     title = "FM2Play"
  400.     classname = 'WPProgram'
  401.     location = '<FM3_Tools>'
  402.     setup = 'EXENAME='rc';OBJECTID=<FM/2_FM2PLAY>;PARAMETERS=/! %*'
  403.     call SysCreateObject classname,title,location,setup,u
  404.   end
  405. end
  406.  
  407. rc = stream('READ.ME','c','query exists')
  408. if rc \= '' then
  409. do
  410.   title = "READ.ME"
  411.   classname = 'WPShadow'
  412.   location = '<FM3_Docs>'
  413.   setup = 'SHADOWID='rc
  414.   call SysCreateObject classname,title,location,setup,u
  415. end
  416.  
  417. rc = stream('HISTORY.TXT','c','query exists')
  418. if rc \= '' then
  419. do
  420.   title = "HISTORY.TXT"
  421.   classname = 'WPShadow'
  422.   location = '<FM3_Docs>'
  423.   setup = 'SHADOWID='rc
  424.   call SysCreateObject classname,title,location,setup,u
  425. end
  426.  
  427. rc = stream('REGISTER.TXT','c','query exists')
  428. if rc \= '' then
  429. do
  430.   title = "REGISTER.TXT"
  431.   classname = 'WPShadow'
  432.   location = '<FM3_Docs>'
  433.   setup = 'SHADOWID='rc
  434.   call SysCreateObject classname,title,location,setup,u
  435. end
  436.  
  437. rc = stream('BMTORDER.FRM','c','query exists')
  438. if rc \= '' then
  439. do
  440.   title = "BMTORDER.FRM"
  441.   classname = 'WPShadow'
  442.   location = '<FM3_Docs>'
  443.   setup = 'SHADOWID='rc
  444.   call SysCreateObject classname,title,location,setup,u
  445. end
  446.  
  447. rc = stream('FM3.HLP','c','query exists')
  448. if rc \= '' then
  449. do
  450.   title = "FM/2 Online Help"
  451.   classname = 'WPProgram'
  452.   location = '<FM3_Docs>'
  453.   setup = 'EXENAME='VIEW.EXE';STARTUPDIR='curdir';PARAMETERS='curdir'\FM3.HLP'
  454.   call SysCreateObject classname,title,location,setup,u
  455. end
  456.  
  457. rc = stream('UTILS\MAKEOBJ.CMD','c','query exists')
  458. if rc \= '' then
  459. do
  460.   title = "Make Object"
  461.   classname = 'WPProgram'
  462.   location = '<FM3_Tools>'
  463.   setup = 'EXENAME='rc';PARAMETERS=%*'
  464.   call SysCreateObject classname,title,location,setup,u
  465. end
  466.  
  467. rc = stream('UTILS\FM2UTILS.DOC','c','query exists')
  468. if rc \= '' then
  469. do
  470.   title = "FM2UTILS.DOC"
  471.   classname = 'WPShadow'
  472.   location = '<FM3_Docs>'
  473.   setup = 'SHADOWID='rc
  474.   call SysCreateObject classname,title,location,setup,u
  475. end
  476.  
  477. /* create sample customizations for the user so they don't start 'blank' */
  478.  
  479. rc = stream('FM3MENU.DAT','c','query exists')
  480. if rc = '' then
  481. do
  482.   rc = stream('FM2MENU.TMP','c','query exists')
  483.   if rc \= '' then
  484.   do
  485.     say 'Creating a sample FM3MENU.DAT file for you.'
  486.     'REN FM3MENU.TMP FM3MENU.DAT 1>NUL 2>NUL'
  487.   end
  488. end
  489. 'DEL FM3MENU.TMP 1>NUL 2>NUL'
  490. rc = stream('ASSOC.DAT','c','query exists')
  491. if rc = '' then
  492. do
  493.   rc = stream('ASSOC.TMP','c','query exists')
  494.   if rc \= '' then
  495.   do
  496.     say 'Creating a sample ASSOC.DAT file for you.'
  497.     'REN ASSOC.TMP ASSOC.DAT 1>NUL 2>NUL'
  498.   end
  499. end
  500. 'DEL ASSOC.TMP 1>NUL 2>NUL'
  501. rc = stream('COMMANDS.DAT','c','query exists')
  502. if rc = '' then
  503. do
  504.   rc = stream('COMMANDS.TMP','c','query exists')
  505.   if rc \= '' then
  506.   do
  507.     say 'Creating a sample COMMANDS.DAT file for you.'
  508.     'REN COMMANDS.TMP COMMANDS.DAT 1>NUL 2>NUL'
  509.   end
  510. end
  511. 'DEL COMMANDS.TMP 1>NUL 2>NUL'
  512. rc = stream('FILTERS.DAT','c','query exists')
  513. if rc = '' then
  514. do
  515.   rc = stream('FILTERS.TMP','c','query exists')
  516.   if rc \= '' then
  517.   do
  518.     say 'Creating a sample FILTERS.DAT file for you.'
  519.     'REN FILTERS.TMP FILTERS.DAT 1>NUL 2>NUL'
  520.   end
  521. end
  522. 'DEL FILTERS.TMP 1>NUL 2>NUL'
  523. rc = stream('FM3TOOLS.DAT','c','query exists')
  524. if rc = '' then
  525. do
  526.   rc = stream('FM3TOOLS.TMP','c','query exists')
  527.   if rc \= '' then
  528.   do
  529.     say 'Installing an FM3TOOLS.DAT file for you.'
  530.     'REN FM3TOOLS.TMP FM3TOOLS.DAT 1>NUL 2>NUL'
  531.   end
  532. end
  533. 'DEL FM3TOOLS.TMP 1>NUL 2>NUL'
  534. rc = stream('QUICKTLS.DAT','c','query exists')
  535. if rc = '' then
  536. do
  537.   rc = stream('QUICKTLS.TMP','c','query exists')
  538.   if rc \= '' then
  539.   do
  540.     rc = stream('CMDS.TMP','c','query exists')
  541.     if rc \= '' then
  542.     do
  543.       rc = stream('UTILS.TMP','c','query exists')
  544.       if rc \= '' then
  545.       do
  546.         rc = stream('SORT.TMP','c','query exists')
  547.         if rc \= '' then
  548.         do
  549.           rc = stream('SELECT.TMP','c','query exists')
  550.           if rc \= '' then
  551.           do
  552.             say 'Creating a sample QUICKTLS.DAT file and toolboxes for you.'
  553.             'REN QUICKTLS.TMP QUICKTLS.DAT 1>NUL 2>NUL'
  554.             'REN CMDS.TMP CMDS.TLS 1>NUL 2>NUL'
  555.             'REN UTILS.TMP UTILS.TLS 1>NUL 2>NUL'
  556.             'REN SORT.TMP SORT.TLS 1>NUL 2>NUL'
  557.             'REN SELECT.TMP SELECT.TLS 1>NUL 2>NUL'
  558.           end
  559.           'DEL SELECT.TMP 1>NUL 2>NUL'
  560.         end
  561.        'DEL SORT.TMP 1>NUL 2>NUL'
  562.       end
  563.       'DEL UTILS.TMP 1>NUL 2>NUL'
  564.     end
  565.     'DEL CMDS.TMP 1>NUL 2>NUL'
  566.   end
  567. end
  568. 'DEL QUICKTLS.TMP 1>NUL 2>NUL'
  569.  
  570. /*
  571.  * create command files that the user can execute from anywhere (we'll
  572.  * ask the user to put this utils directory on the PATH) and that other
  573.  * programs can execute to use FM/2 as "their" file manager.
  574.  */
  575.  
  576. 'del SETENV.CMD 1>NUL 2>NUL'
  577. dummy = stream('SETENV.CMD','C','open')
  578. if dummy = 'READY:' then
  579. do
  580.   call lineout 'SETENV.CMD','@ECHO OFF'
  581.   call lineout 'SETENV.CMD','REM'
  582.   call lineout 'SETENV.CMD','REM If you prefer, you can call this .CMD file'
  583.   call lineout 'SETENV.CMD','REM instead of altering the PATH= statement in'
  584.   call lineout 'SETENV.CMD','REM CONFIG.SYS to gain access to the FM/2'
  585.   call lineout 'SETENV.CMD','REM command line utilities.'
  586.   call lineout 'SETENV.CMD','REM'
  587.   call lineout 'SETENV.CMD','IF "%FM2ENVSET%" == "" GOTO INSTALL'
  588.   call lineout 'SETENV.CMD','GOTO SKIP'
  589.   call lineout 'SETENV.CMD',':INSTALL'
  590.   call lineout 'SETENV.CMD','SET FM2ENVSET=YES'
  591.   call lineout 'SETENV.CMD','SET PATH=%PATH%;'curdir'\utils;'
  592.   call lineout 'SETENV.CMD','SET BEGINLIBPATH='curdir
  593.   call lineout 'SETENV.CMD','SET FM3INI='curdir
  594.   call lineout 'SETENV.CMD','ECHO Path set for FM/2 and utilities.'
  595.   call lineout 'SETENV.CMD','GOTO END'
  596.   call lineout 'SETENV.CMD',':SKIP'
  597.   call lineout 'SETENV.CMD','ECHO Paths already set for FM/2 and utilities.'
  598.   call lineout 'SETENV.CMD',':END'
  599.   call stream 'SETENV.CMD','C','close'
  600. end
  601.  
  602. /*
  603.  * place an object for SETENV.CMD in folder so user doesn't have to diddle
  604.  * their PATH statement if they don't want to for command line work.
  605.  */
  606.  
  607.  
  608. rc = stream('SETENV.CMD','c','query exists')
  609. if rc \= '' then
  610. do
  611.   dummy = value('COMSPEC',,'OS2ENVIRONMENT')
  612.   if dummy = '' then dummy = value('OS2_SHELL',,'OS2ENVIRONMENT')
  613.   if dummy = '' then dummy = 'CMD.EXE'
  614.   title = "FM/2 Utilities command line"
  615.   classname = 'WPProgram'
  616.   location = '<FM3_Tools>'
  617.   setup = 'EXENAME='dummy';PARAMETERS=/K 'rc';STARTUPDIR=C:\'
  618.   call SysCreateObject classname,title,location,setup,u
  619. end
  620.  
  621. call SysMkDir curdir'\UTILS'
  622. dummy = directory(curdir'\UTILS')
  623. if dummy = curdir'\UTILS' then
  624. do
  625.   'set PATH=%PATH%;'curdir'\utils'
  626.   'move ..\example.cmd 1>NUL 2>NUL'
  627.   'del FM2.CMD 1>NUL 2>NUL'
  628.   dummy = stream('FM2.CMD','C','open')
  629.   if dummy = 'READY:' then
  630.   do
  631.     say 'Creating an FM2.CMD file.'
  632.     call lineout 'FM2.CMD', "/* FM/2 command file.  Locate in a directory"
  633.     call lineout 'FM2.CMD', " * on your PATH. */"
  634.     call lineout 'FM2.CMD', "'@echo off'"
  635.       call lineout 'FM2.CMD', "mydir = directory()"
  636.       call lineout 'FM2.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  637.       call lineout 'FM2.CMD', "if arg1 \= '' then "
  638.       call lineout 'FM2.CMD', "do"
  639.       call lineout 'FM2.CMD', "  if left(arg1,1,1) \= '/' then"
  640.       call lineout 'FM2.CMD', "  do"
  641.       call lineout 'FM2.CMD', "    arg0 = arg1"
  642.       call lineout 'FM2.CMD', "    arg1 = stream(arg1,'c','query exists')"
  643.       call lineout 'FM2.CMD', "    if arg1 = '' then"
  644.       call lineout 'FM2.CMD', "    do"
  645.       call lineout 'FM2.CMD', "      arg1 = directory(arg0)"
  646.       call lineout 'FM2.CMD', "      call directory mydir"
  647.       call lineout 'FM2.CMD', "    end"
  648.       call lineout 'FM2.CMD', "  end"
  649.       call lineout 'FM2.CMD', "end"
  650.       call lineout 'FM2.CMD', "else arg1 = mydir"
  651.       call lineout 'FM2.CMD', "if arg2 \= '' then "
  652.       call lineout 'FM2.CMD', "do"
  653.       call lineout 'FM2.CMD', "  if left(arg2,1,1) \= '/' then"
  654.       call lineout 'FM2.CMD', "  do"
  655.       call lineout 'FM2.CMD', "    arg0 = arg2"
  656.       call lineout 'FM2.CMD', "    arg2 = stream(arg2,'c','query exists')"
  657.       call lineout 'FM2.CMD', "    if arg2 = '' then"
  658.       call lineout 'FM2.CMD', "    do"
  659.       call lineout 'FM2.CMD', "      arg2 = directory(arg0)"
  660.       call lineout 'FM2.CMD', "      call directory mydir"
  661.       call lineout 'FM2.CMD', "    end"
  662.       call lineout 'FM2.CMD', "  end"
  663.       call lineout 'FM2.CMD', "end"
  664.       call lineout 'FM2.CMD', "if arg3 \= '' then "
  665.       call lineout 'FM2.CMD', "do"
  666.       call lineout 'FM2.CMD', "  if left(arg3,1,1) \= '/' then"
  667.       call lineout 'FM2.CMD', "  do"
  668.       call lineout 'FM2.CMD', "    arg0 = arg3"
  669.       call lineout 'FM2.CMD', "    arg3 = stream(arg3,'c','query exists')"
  670.       call lineout 'FM2.CMD', "    if arg3 = '' then"
  671.       call lineout 'FM2.CMD', "    do"
  672.       call lineout 'FM2.CMD', "      arg3 = directory(arg0)"
  673.       call lineout 'FM2.CMD', "      call directory mydir"
  674.       call lineout 'FM2.CMD', "    end"
  675.       call lineout 'FM2.CMD', "  end"
  676.       call lineout 'FM2.CMD', "end"
  677.       call lineout 'FM2.CMD', "if arg4 \= '' then "
  678.       call lineout 'FM2.CMD', "do"
  679.       call lineout 'FM2.CMD', "  if left(arg4,1,1) \= '/' then"
  680.       call lineout 'FM2.CMD', "  do"
  681.       call lineout 'FM2.CMD', "    arg0 = arg4"
  682.       call lineout 'FM2.CMD', "    arg4 = stream(arg4,'c','query exists')"
  683.       call lineout 'FM2.CMD', "    if arg4 = '' then"
  684.       call lineout 'FM2.CMD', "    do"
  685.       call lineout 'FM2.CMD', "      arg4 = directory(arg0)"
  686.       call lineout 'FM2.CMD', "      call directory mydir"
  687.       call lineout 'FM2.CMD', "    end"
  688.       call lineout 'FM2.CMD', "  end"
  689.       call lineout 'FM2.CMD', "end"
  690.       call lineout 'FM2.CMD', "if arg5 \= '' then "
  691.       call lineout 'FM2.CMD', "do"
  692.       call lineout 'FM2.CMD', "  if left(arg5,1,1) \= '/' then"
  693.       call lineout 'FM2.CMD', "  do"
  694.       call lineout 'FM2.CMD', "    arg0 = arg5"
  695.       call lineout 'FM2.CMD', "    arg5 = stream(arg5,'c','query exists')"
  696.       call lineout 'FM2.CMD', "    if arg5 = '' then"
  697.       call lineout 'FM2.CMD', "    do"
  698.       call lineout 'FM2.CMD', "      arg5 = directory(arg0)"
  699.       call lineout 'FM2.CMD', "      call directory mydir"
  700.       call lineout 'FM2.CMD', "    end"
  701.       call lineout 'FM2.CMD', "  end"
  702.       call lineout 'FM2.CMD', "end"
  703.       call lineout 'FM2.CMD', "if arg6 \= '' then "
  704.       call lineout 'FM2.CMD', "do"
  705.       call lineout 'FM2.CMD', "  if left(arg6,1,1) \= '/' then"
  706.       call lineout 'FM2.CMD', "  do"
  707.       call lineout 'FM2.CMD', "    arg0 = arg6"
  708.       call lineout 'FM2.CMD', "    arg6 = stream(arg6,'c','query exists')"
  709.       call lineout 'FM2.CMD', "    if arg6 = '' then"
  710.       call lineout 'FM2.CMD', "    do"
  711.       call lineout 'FM2.CMD', "      arg6 = directory(arg0)"
  712.       call lineout 'FM2.CMD', "      call directory mydir"
  713.       call lineout 'FM2.CMD', "    end"
  714.       call lineout 'FM2.CMD', "  end"
  715.       call lineout 'FM2.CMD', "end"
  716.       call lineout 'FM2.CMD', "if arg7 \= '' then "
  717.       call lineout 'FM2.CMD', "do"
  718.       call lineout 'FM2.CMD', "  if left(arg7,1,1) \= '/' then"
  719.       call lineout 'FM2.CMD', "  do"
  720.       call lineout 'FM2.CMD', "    arg0 = arg7"
  721.       call lineout 'FM2.CMD', "    arg7 = stream(arg7,'c','query exists')"
  722.       call lineout 'FM2.CMD', "    if arg7 = '' then"
  723.       call lineout 'FM2.CMD', "    do"
  724.       call lineout 'FM2.CMD', "      arg7 = directory(arg0)"
  725.       call lineout 'FM2.CMD', "      call directory mydir"
  726.       call lineout 'FM2.CMD', "    end"
  727.       call lineout 'FM2.CMD', "  end"
  728.       call lineout 'FM2.CMD', "end"
  729.       call lineout 'FM2.CMD', "if arg8 \= '' then "
  730.       call lineout 'FM2.CMD', "do"
  731.       call lineout 'FM2.CMD', "  if left(arg8,1,1) \= '/' then"
  732.       call lineout 'FM2.CMD', "  do"
  733.       call lineout 'FM2.CMD', "    arg0 = arg8"
  734.       call lineout 'FM2.CMD', "    arg8 = stream(arg8,'c','query exists')"
  735.       call lineout 'FM2.CMD', "    if arg8 = '' then"
  736.       call lineout 'FM2.CMD', "    do"
  737.       call lineout 'FM2.CMD', "      arg8 = directory(arg0)"
  738.       call lineout 'FM2.CMD', "      call directory mydir"
  739.       call lineout 'FM2.CMD', "    end"
  740.       call lineout 'FM2.CMD', "  end"
  741.       call lineout 'FM2.CMD', "end"
  742.       call lineout 'FM2.CMD', "if arg9 \= '' then "
  743.       call lineout 'FM2.CMD', "do"
  744.       call lineout 'FM2.CMD', "  if left(arg9,1,1) \= '/' then"
  745.       call lineout 'FM2.CMD', "  do"
  746.       call lineout 'FM2.CMD', "    arg0 = arg9"
  747.       call lineout 'FM2.CMD', "    arg9 = stream(arg9,'c','query exists')"
  748.       call lineout 'FM2.CMD', "    if arg9 = '' then"
  749.       call lineout 'FM2.CMD', "    do"
  750.       call lineout 'FM2.CMD', "      arg9 = directory(arg0)"
  751.       call lineout 'FM2.CMD', "      call directory mydir"
  752.       call lineout 'FM2.CMD', "    end"
  753.       call lineout 'FM2.CMD', "  end"
  754.       call lineout 'FM2.CMD', "end"
  755.     call lineout 'FM2.CMD', "n = setlocal()"
  756.     call lineout 'FM2.CMD', "n = directory('"curdir"')"
  757.     call lineout 'FM2.CMD', "'start fm3.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  758.     call lineout 'FM2.CMD', "n = endlocal()"
  759.     call stream 'FM2.CMD','C','close'
  760.     'del AV2.CMD 1>NUL 2>NUL'
  761.     dummy = stream('AV2.CMD','C','open')
  762.     if dummy = 'READY:' then
  763.     do
  764.       say 'Creating an AV2.CMD file.'
  765.       call lineout 'AV2.CMD', "@echo off"
  766.       call lineout 'AV2.CMD', "rem AV/2 command file.  Locate in a directory"
  767.       call lineout 'AV2.CMD', "rem on your PATH."
  768.       call lineout 'AV2.CMD', "setlocal"
  769.       call lineout 'AV2.CMD', "set FM3INI="curdir
  770.       call lineout 'AV2.CMD', "set BEGINLIBPATH="curdir
  771.       call lineout 'AV2.CMD', "start "curdir"\av2.exe %1 %2 %3 %4 %5 %6 %7 %8 %9"
  772.       call lineout 'AV2.CMD', "endlocal"
  773.       call stream 'AV2.CMD','C','close'
  774.     end
  775.     else say "Couldn't create AV2.CMD file."
  776.     'del VDIR.CMD 1>NUL 2>NUL'
  777.     dummy = stream('VDIR.CMD','C','open')
  778.     if dummy = 'READY:' then
  779.     do
  780.       say 'Creating a VDIR.CMD file.'
  781.       call lineout 'VDIR.CMD', "/* VDIR (FM/2) command file.  Locate in a directory"
  782.       call lineout 'VDIR.CMD', " * on your PATH. */"
  783.       call lineout 'VDIR.CMD', "'@echo off'"
  784.       call lineout 'VDIR.CMD', "mydir = directory()"
  785.       call lineout 'VDIR.CMD', "arg arg1 arg2"
  786.       call lineout 'VDIR.CMD', "if arg1 \= '' then "
  787.       call lineout 'VDIR.CMD', "do"
  788.       call lineout 'VDIR.CMD', "  if left(arg1,1,1) \= '/' then"
  789.       call lineout 'VDIR.CMD', "  do"
  790.       call lineout 'VDIR.CMD', "    arg0 = arg1"
  791.       call lineout 'VDIR.CMD', "    arg1 = stream(arg1,'c','query exists')"
  792.       call lineout 'VDIR.CMD', "    if arg1 = '' then"
  793.       call lineout 'VDIR.CMD', "    do"
  794.       call lineout 'VDIR.CMD', "      arg1 = directory(arg0)"
  795.       call lineout 'VDIR.CMD', "      call directory mydir"
  796.       call lineout 'VDIR.CMD', "    end"
  797.       call lineout 'VDIR.CMD', "  end"
  798.       call lineout 'VDIR.CMD', "end"
  799.       call lineout 'VDIR.CMD', "else arg1 = mydir"
  800.       call lineout 'VDIR.CMD', "n = setlocal()"
  801.       call lineout 'VDIR.CMD', "n = directory('"curdir"')"
  802.       call lineout 'VDIR.CMD', "'start vdir.exe 'arg1 '%2 %3 %4 %5 %6 %7 %8 %9'"
  803.       call lineout 'VDIR.CMD', "n = endlocal()"
  804.       call stream 'VDIR.CMD','C','close'
  805.     end
  806.     else say "Couldn't create VDIR.CMD file."
  807.     'del VTREE.CMD 1>NUL 2>NUL'
  808.     dummy = stream('VTREE.CMD','C','open')
  809.     if dummy = 'READY:' then
  810.     do
  811.       say 'Creating a VTREE.CMD file.'
  812.       call lineout 'VTREE.CMD', "/* VTREE (FM/2) command file.  Locate in a directory"
  813.       call lineout 'VTREE.CMD', " * on your PATH. */"
  814.       call lineout 'VTREE.CMD', "'@echo off'"
  815.       call lineout 'VTREE.CMD', "n = setlocal()"
  816.       call lineout 'VTREE.CMD', "n = directory('"curdir"')"
  817.       call lineout 'VTREE.CMD', "'start vtree.exe %1 %2 %3 %4 %5 %6 %7 %8 %9'"
  818.       call lineout 'VTREE.CMD', "n = endlocal()"
  819.       call stream 'VTREE.CMD','C','close'
  820.     end
  821.     else say "Couldn't create VTREE.CMD file."
  822.     'del VCOLLECT.CMD 1>NUL 2>NUL'
  823.     dummy = stream('VCOLLECT.CMD','C','open')
  824.     if dummy = 'READY:' then
  825.     do
  826.       say 'Creating a VCOLLECT.CMD file.'
  827.       call lineout 'VCOLLECT.CMD', "/* VCOLLECT (FM/2) command file.  Locate in a directory"
  828.       call lineout 'VCOLLECT.CMD', " * on your PATH. */"
  829.       call lineout 'VCOLLECT.CMD', "'@echo off'"
  830.       call lineout 'VCOLLECT.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  831.       call lineout 'VCOLLECT.CMD', "if arg1 \= '' then "
  832.       call lineout 'VCOLLECT.CMD', "do"
  833.       call lineout 'VCOLLECT.CMD', "  if left(arg1,1,1) \= '/' then"
  834.       call lineout 'VCOLLECT.CMD', "  do"
  835.       call lineout 'VCOLLECT.CMD', "    arg1 = stream(arg1,'c','query exists')"
  836.       call lineout 'VCOLLECT.CMD', "  end"
  837.       call lineout 'VCOLLECT.CMD', "end"
  838.       call lineout 'VCOLLECT.CMD', "if arg2 \= '' then "
  839.       call lineout 'VCOLLECT.CMD', "do"
  840.       call lineout 'VCOLLECT.CMD', "  if left(arg2,1,1) \= '/' then"
  841.       call lineout 'VCOLLECT.CMD', "  do"
  842.       call lineout 'VCOLLECT.CMD', "    arg2 = stream(arg2,'c','query exists')"
  843.       call lineout 'VCOLLECT.CMD', "  end"
  844.       call lineout 'VCOLLECT.CMD', "end"
  845.       call lineout 'VCOLLECT.CMD', "if arg3 \= '' then "
  846.       call lineout 'VCOLLECT.CMD', "do"
  847.       call lineout 'VCOLLECT.CMD', "  if left(arg3,1,1) \= '/' then"
  848.       call lineout 'VCOLLECT.CMD', "  do"
  849.       call lineout 'VCOLLECT.CMD', "    arg3 = stream(arg3,'c','query exists')"
  850.       call lineout 'VCOLLECT.CMD', "  end"
  851.       call lineout 'VCOLLECT.CMD', "end"
  852.       call lineout 'VCOLLECT.CMD', "if arg4 \= '' then "
  853.       call lineout 'VCOLLECT.CMD', "do"
  854.       call lineout 'VCOLLECT.CMD', "  if left(arg4,1,1) \= '/' then"
  855.       call lineout 'VCOLLECT.CMD', "  do"
  856.       call lineout 'VCOLLECT.CMD', "    arg4 = stream(arg4,'c','query exists')"
  857.       call lineout 'VCOLLECT.CMD', "  end"
  858.       call lineout 'VCOLLECT.CMD', "end"
  859.       call lineout 'VCOLLECT.CMD', "if arg5 \= '' then "
  860.       call lineout 'VCOLLECT.CMD', "do"
  861.       call lineout 'VCOLLECT.CMD', "  if left(arg5,1,1) \= '/' then"
  862.       call lineout 'VCOLLECT.CMD', "  do"
  863.       call lineout 'VCOLLECT.CMD', "    arg5 = stream(arg5,'c','query exists')"
  864.       call lineout 'VCOLLECT.CMD', "  end"
  865.       call lineout 'VCOLLECT.CMD', "end"
  866.       call lineout 'VCOLLECT.CMD', "if arg6 \= '' then "
  867.       call lineout 'VCOLLECT.CMD', "do"
  868.       call lineout 'VCOLLECT.CMD', "  if left(arg6,1,1) \= '/' then"
  869.       call lineout 'VCOLLECT.CMD', "  do"
  870.       call lineout 'VCOLLECT.CMD', "    arg6 = stream(arg6,'c','query exists')"
  871.       call lineout 'VCOLLECT.CMD', "  end"
  872.       call lineout 'VCOLLECT.CMD', "end"
  873.       call lineout 'VCOLLECT.CMD', "if arg7 \= '' then "
  874.       call lineout 'VCOLLECT.CMD', "do"
  875.       call lineout 'VCOLLECT.CMD', "  if left(arg7,1,1) \= '/' then"
  876.       call lineout 'VCOLLECT.CMD', "  do"
  877.       call lineout 'VCOLLECT.CMD', "    arg7 = stream(arg7,'c','query exists')"
  878.       call lineout 'VCOLLECT.CMD', "  end"
  879.       call lineout 'VCOLLECT.CMD', "end"
  880.       call lineout 'VCOLLECT.CMD', "if arg8 \= '' then "
  881.       call lineout 'VCOLLECT.CMD', "do"
  882.       call lineout 'VCOLLECT.CMD', "  if left(arg8,1,1) \= '/' then"
  883.       call lineout 'VCOLLECT.CMD', "  do"
  884.       call lineout 'VCOLLECT.CMD', "    arg8 = stream(arg8,'c','query exists')"
  885.       call lineout 'VCOLLECT.CMD', "  end"
  886.       call lineout 'VCOLLECT.CMD', "end"
  887.       call lineout 'VCOLLECT.CMD', "if arg9 \= '' then "
  888.       call lineout 'VCOLLECT.CMD', "do"
  889.       call lineout 'VCOLLECT.CMD', "  if left(arg9,1,1) \= '/' then"
  890.       call lineout 'VCOLLECT.CMD', "  do"
  891.       call lineout 'VCOLLECT.CMD', "    arg9 = stream(arg9,'c','query exists')"
  892.       call lineout 'VCOLLECT.CMD', "  end"
  893.       call lineout 'VCOLLECT.CMD', "end"
  894.       call lineout 'VCOLLECT.CMD', "n = setlocal()"
  895.       call lineout 'VCOLLECT.CMD', "n = directory('"curdir"')"
  896.       call lineout 'VCOLLECT.CMD', "'start vcollect.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  897.       call lineout 'VCOLLECT.CMD', "n = endlocal()"
  898.       call stream 'VCOLLECT.CMD','C','close'
  899.     end
  900.     else say "Couldn't create VCOLLECT.CMD file."
  901.     'del INI.CMD 1>NUL 2>NUL'
  902.     dummy = stream('INI.CMD','C','open')
  903.     if dummy = 'READY:' then
  904.     do
  905.       say 'Creating an INI.CMD file.'
  906.       call lineout 'INI.CMD', "/* INI (FM/2) command file.  Locate in a directory"
  907.       call lineout 'INI.CMD', " * on your PATH. */"
  908.       call lineout 'INI.CMD', "'@echo off'"
  909.       call lineout 'INI.CMD', "arg arg1"
  910.       call lineout 'INI.CMD', "if arg1 \= '' then arg1 = stream(arg1,'c','query exists')"
  911.       call lineout 'INI.CMD', "n = setlocal()"
  912.       call lineout 'INI.CMD', "n = directory('"curdir"')"
  913.       call lineout 'INI.CMD', "'start INI.exe 'arg1"
  914.       call lineout 'INI.CMD', "n = endlocal()"
  915.       call stream 'INI.CMD','C','close'
  916.     end
  917.     else say "Couldn't create INI.CMD file."
  918.     'del EAS.CMD 1>NUL 2>NUL'
  919.     dummy = stream('EAS.CMD','C','open')
  920.     if dummy = 'READY:' then
  921.     do
  922.       say 'Creating an EAS.CMD file.'
  923.       call lineout 'EAS.CMD', "/* EAS (FM/2) command file.  Locate in a directory"
  924.       call lineout 'EAS.CMD', " * on your PATH. */"
  925.       call lineout 'EAS.CMD', "'@echo off'"
  926.       call lineout 'EAS.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  927.       call lineout 'EAS.CMD', "if arg1 \= '' then "
  928.       call lineout 'EAS.CMD', "do"
  929.       call lineout 'EAS.CMD', "  if left(arg1,1,1) \= '/' then"
  930.       call lineout 'EAS.CMD', "  do"
  931.       call lineout 'EAS.CMD', "    arg1 = stream(arg1,'c','query exists')"
  932.       call lineout 'EAS.CMD', "  end"
  933.       call lineout 'EAS.CMD', "end"
  934.       call lineout 'EAS.CMD', "else arg1 = directory()"
  935.       call lineout 'EAS.CMD', "if arg2 \= '' then "
  936.       call lineout 'EAS.CMD', "do"
  937.       call lineout 'EAS.CMD', "  if left(arg2,1,1) \= '/' then"
  938.       call lineout 'EAS.CMD', "  do"
  939.       call lineout 'EAS.CMD', "    arg2 = stream(arg2,'c','query exists')"
  940.       call lineout 'EAS.CMD', "  end"
  941.       call lineout 'EAS.CMD', "end"
  942.       call lineout 'EAS.CMD', "if arg3 \= '' then "
  943.       call lineout 'EAS.CMD', "do"
  944.       call lineout 'EAS.CMD', "  if left(arg3,1,1) \= '/' then"
  945.       call lineout 'EAS.CMD', "  do"
  946.       call lineout 'EAS.CMD', "    arg3 = stream(arg3,'c','query exists')"
  947.       call lineout 'EAS.CMD', "  end"
  948.       call lineout 'EAS.CMD', "end"
  949.       call lineout 'EAS.CMD', "if arg4 \= '' then "
  950.       call lineout 'EAS.CMD', "do"
  951.       call lineout 'EAS.CMD', "  if left(arg4,1,1) \= '/' then"
  952.       call lineout 'EAS.CMD', "  do"
  953.       call lineout 'EAS.CMD', "    arg4 = stream(arg4,'c','query exists')"
  954.       call lineout 'EAS.CMD', "  end"
  955.       call lineout 'EAS.CMD', "end"
  956.       call lineout 'EAS.CMD', "if arg5 \= '' then "
  957.       call lineout 'EAS.CMD', "do"
  958.       call lineout 'EAS.CMD', "  if left(arg5,1,1) \= '/' then"
  959.       call lineout 'EAS.CMD', "  do"
  960.       call lineout 'EAS.CMD', "    arg5 = stream(arg5,'c','query exists')"
  961.       call lineout 'EAS.CMD', "  end"
  962.       call lineout 'EAS.CMD', "end"
  963.       call lineout 'EAS.CMD', "if arg6 \= '' then "
  964.       call lineout 'EAS.CMD', "do"
  965.       call lineout 'EAS.CMD', "  if left(arg6,1,1) \= '/' then"
  966.       call lineout 'EAS.CMD', "  do"
  967.       call lineout 'EAS.CMD', "    arg6 = stream(arg6,'c','query exists')"
  968.       call lineout 'EAS.CMD', "  end"
  969.       call lineout 'EAS.CMD', "end"
  970.       call lineout 'EAS.CMD', "if arg7 \= '' then "
  971.       call lineout 'EAS.CMD', "do"
  972.       call lineout 'EAS.CMD', "  if left(arg7,1,1) \= '/' then"
  973.       call lineout 'EAS.CMD', "  do"
  974.       call lineout 'EAS.CMD', "    arg7 = stream(arg7,'c','query exists')"
  975.       call lineout 'EAS.CMD', "  end"
  976.       call lineout 'EAS.CMD', "end"
  977.       call lineout 'EAS.CMD', "if arg8 \= '' then "
  978.       call lineout 'EAS.CMD', "do"
  979.       call lineout 'EAS.CMD', "  if left(arg8,1,1) \= '/' then"
  980.       call lineout 'EAS.CMD', "  do"
  981.       call lineout 'EAS.CMD', "    arg8 = stream(arg8,'c','query exists')"
  982.       call lineout 'EAS.CMD', "  end"
  983.       call lineout 'EAS.CMD', "end"
  984.       call lineout 'EAS.CMD', "if arg9 \= '' then "
  985.       call lineout 'EAS.CMD', "do"
  986.       call lineout 'EAS.CMD', "  if left(arg9,1,1) \= '/' then"
  987.       call lineout 'EAS.CMD', "  do"
  988.       call lineout 'EAS.CMD', "    arg9 = stream(arg9,'c','query exists')"
  989.       call lineout 'EAS.CMD', "  end"
  990.       call lineout 'EAS.CMD', "end"
  991.       call lineout 'EAS.CMD', "n = setlocal()"
  992.       call lineout 'EAS.CMD', "n = directory('"curdir"')"
  993.       call lineout 'EAS.CMD', "'start eas.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  994.       call lineout 'EAS.CMD', "n = endlocal()"
  995.       call stream 'EAS.CMD','C','close'
  996.     end
  997.     else say "Couldn't create EAS.CMD file."
  998.     'del DIRSIZE.CMD 1>NUL 2>NUL'
  999.     dummy = stream('DIRSIZE.CMD','C','open')
  1000.     if dummy = 'READY:' then
  1001.     do
  1002.       say 'Creating a DIRSIZE.CMD file.'
  1003.       call lineout 'DIRSIZE.CMD', "/* DIRSIZE (FM/2) command file.  Locate in a directory"
  1004.       call lineout 'DIRSIZE.CMD', " * on your PATH. */"
  1005.       call lineout 'DIRSIZE.CMD', "'@echo off'"
  1006.       call lineout 'DIRSIZE.CMD', "mydir = directory()"
  1007.       call lineout 'DIRSIZE.CMD', "arg arg1 arg2"
  1008.       call lineout 'DIRSIZE.CMD', "if arg1 \= '' then "
  1009.       call lineout 'DIRSIZE.CMD', "do"
  1010.       call lineout 'DIRSIZE.CMD', "  if left(arg1,1,1) \= '/' then"
  1011.       call lineout 'DIRSIZE.CMD', "  do"
  1012.       call lineout 'DIRSIZE.CMD', "    arg0 = arg1"
  1013.       call lineout 'DIRSIZE.CMD', "    arg1 = stream(arg1,'c','query exists')"
  1014.       call lineout 'DIRSIZE.CMD', "    if arg1 = '' then"
  1015.       call lineout 'DIRSIZE.CMD', "    do"
  1016.       call lineout 'DIRSIZE.CMD', "      arg1 = directory(arg0)"
  1017.       call lineout 'DIRSIZE.CMD', "      call directory mydir"
  1018.       call lineout 'DIRSIZE.CMD', "    end"
  1019.       call lineout 'DIRSIZE.CMD', "  end"
  1020.       call lineout 'DIRSIZE.CMD', "end"
  1021.       call lineout 'DIRSIZE.CMD', "else arg1 = mydir"
  1022.       call lineout 'DIRSIZE.CMD', "n = setlocal()"
  1023.       call lineout 'DIRSIZE.CMD', "n = directory('"curdir"')"
  1024.       call lineout 'DIRSIZE.CMD', "'start dirsize.exe 'arg1 '%2 %3 %4 %5 %6 %7 %8 %9'"
  1025.       call lineout 'DIRSIZE.CMD', "n = endlocal()"
  1026.       call stream 'DIRSIZE.CMD','C','close'
  1027.     end
  1028.     else say "Couldn't create DIRSIZE.CMD file."
  1029.     'del UNDEL.CMD 1>NUL 2>NUL'
  1030.     dummy = stream('UNDEL.CMD','C','open')
  1031.     if dummy = 'READY:' then
  1032.     do
  1033.       say 'Creating an UNDEL.CMD file.'
  1034.       call lineout 'UNDEL.CMD', "/* UNDEL (FM/2) command file.  Locate in a directory"
  1035.       call lineout 'UNDEL.CMD', " * on your PATH. */"
  1036.       call lineout 'UNDEL.CMD', "'@echo off'"
  1037.       call lineout 'UNDEL.CMD', "n = setlocal()"
  1038.       call lineout 'UNDEL.CMD', "n = directory('"curdir"')"
  1039.       call lineout 'UNDEL.CMD', "'start undel.exe %1'"
  1040.       call lineout 'UNDEL.CMD', "n = endlocal()"
  1041.       call stream 'UNDEL.CMD','C','close'
  1042.     end
  1043.     else say "Couldn't create UNDEL.CMD file."
  1044.     'del KILLPROC.CMD 1>NUL 2>NUL'
  1045.     dummy = stream('KILLPROC.CMD','C','open')
  1046.     if dummy = 'READY:' then
  1047.     do
  1048.       say 'Creating a KILLPROC.CMD file.'
  1049.       call lineout 'KILLPROC.CMD', "/* KILLPROC (FM/2) command file.  Locate in a directory"
  1050.       call lineout 'KILLPROC.CMD', " * on your PATH. */"
  1051.       call lineout 'KILLPROC.CMD', "'@echo off'"
  1052.       call lineout 'KILLPROC.CMD', "n = setlocal()"
  1053.       call lineout 'KILLPROC.CMD', "n = directory('"curdir"')"
  1054.       call lineout 'KILLPROC.CMD', "'start killproc.exe'"
  1055.       call lineout 'KILLPROC.CMD', "n = endlocal()"
  1056.       call stream 'KILLPROC.CMD','C','close'
  1057.     end
  1058.     else say "Couldn't create KILLPROC.CMD file."
  1059.     'del VIEWINFS.CMD 1>NUL 2>NUL'
  1060.     dummy = stream('VIEWINFS.CMD','C','open')
  1061.     if dummy = 'READY:' then
  1062.     do
  1063.       say 'Creating a VIEWINFS.CMD file.'
  1064.       call lineout 'VIEWINFS.CMD', "/* VIEWINFS (FM/2) command file.  Locate in a directory"
  1065.       call lineout 'VIEWINFS.CMD', " * on your PATH. */"
  1066.       call lineout 'VIEWINFS.CMD', "'@echo off'"
  1067.       call lineout 'VIEWINFS.CMD', "n = setlocal()"
  1068.       call lineout 'VIEWINFS.CMD', "n = directory('"curdir"')"
  1069.       call lineout 'VIEWINFS.CMD', "'start viewinfs.exe'"
  1070.       call lineout 'VIEWINFS.CMD', "n = endlocal()"
  1071.       call stream 'VIEWINFS.CMD','C','close'
  1072.     end
  1073.     else say "Couldn't create VIEWINFS.CMD file."
  1074.     'del VIEWHELP.CMD 1>NUL 2>NUL'
  1075.     dummy = stream('VIEWHELP.CMD','C','open')
  1076.     if dummy = 'READY:' then
  1077.     do
  1078.       say 'Creating a VIEWHELP.CMD file.'
  1079.       call lineout 'VIEWHELP.CMD', "/* VIEWHELP (FM/2) command file.  Locate in a directory"
  1080.       call lineout 'VIEWHELP.CMD', " * on your PATH. */"
  1081.       call lineout 'VIEWHELP.CMD', "'@echo off'"
  1082.       call lineout 'VIEWHELP.CMD', "n = setlocal()"
  1083.       call lineout 'VIEWHELP.CMD', "n = directory('"curdir"')"
  1084.       call lineout 'VIEWHELP.CMD', "'start viewinfs.exe DUMMY'"
  1085.       call lineout 'VIEWHELP.CMD', "n = endlocal()"
  1086.       call stream 'VIEWHELP.CMD','C','close'
  1087.     end
  1088.     else say "Couldn't create VIEWHELP.CMD file."
  1089.     'del GLOBAL.CMD 1>NUL 2>NUL'
  1090.     dummy = stream('GLOBAL.CMD','C','open')
  1091.     if dummy = 'READY:' then
  1092.     do
  1093.       say 'Creating a GLOBAL.CMD file.'
  1094.       call lineout 'GLOBAL.CMD', "/* GLOBAL (FM/2) command file.  Locate in a directory"
  1095.       call lineout 'GLOBAL.CMD', " * on your PATH. */"
  1096.       call lineout 'GLOBAL.CMD', "'@echo off'"
  1097.       call lineout 'GLOBAL.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  1098.       call lineout 'GLOBAL.CMD', "if arg1 \= '' then "
  1099.       call lineout 'GLOBAL.CMD', "do"
  1100.       call lineout 'GLOBAL.CMD', "  if left(arg1,1,1) \= '/' then"
  1101.       call lineout 'GLOBAL.CMD', "  do"
  1102.       call lineout 'GLOBAL.CMD', "    arg1 = stream(arg1,'c','query exists')"
  1103.       call lineout 'GLOBAL.CMD', "  end"
  1104.       call lineout 'GLOBAL.CMD', "end"
  1105.       call lineout 'GLOBAL.CMD', "else arg1 = directory()"
  1106.       call lineout 'GLOBAL.CMD', "if arg2 \= '' then "
  1107.       call lineout 'GLOBAL.CMD', "do"
  1108.       call lineout 'GLOBAL.CMD', "  if left(arg2,1,1) \= '/' then"
  1109.       call lineout 'GLOBAL.CMD', "  do"
  1110.       call lineout 'GLOBAL.CMD', "    arg2 = stream(arg2,'c','query exists')"
  1111.       call lineout 'GLOBAL.CMD', "  end"
  1112.       call lineout 'GLOBAL.CMD', "end"
  1113.       call lineout 'GLOBAL.CMD', "if arg3 \= '' then "
  1114.       call lineout 'GLOBAL.CMD', "do"
  1115.       call lineout 'GLOBAL.CMD', "  if left(arg3,1,1) \= '/' then"
  1116.       call lineout 'GLOBAL.CMD', "  do"
  1117.       call lineout 'GLOBAL.CMD', "    arg3 = stream(arg3,'c','query exists')"
  1118.       call lineout 'GLOBAL.CMD', "  end"
  1119.       call lineout 'GLOBAL.CMD', "end"
  1120.       call lineout 'GLOBAL.CMD', "if arg4 \= '' then "
  1121.       call lineout 'GLOBAL.CMD', "do"
  1122.       call lineout 'GLOBAL.CMD', "  if left(arg4,1,1) \= '/' then"
  1123.       call lineout 'GLOBAL.CMD', "  do"
  1124.       call lineout 'GLOBAL.CMD', "    arg4 = stream(arg4,'c','query exists')"
  1125.       call lineout 'GLOBAL.CMD', "  end"
  1126.       call lineout 'GLOBAL.CMD', "end"
  1127.       call lineout 'GLOBAL.CMD', "if arg5 \= '' then "
  1128.       call lineout 'GLOBAL.CMD', "do"
  1129.       call lineout 'GLOBAL.CMD', "  if left(arg5,1,1) \= '/' then"
  1130.       call lineout 'GLOBAL.CMD', "  do"
  1131.       call lineout 'GLOBAL.CMD', "    arg5 = stream(arg5,'c','query exists')"
  1132.       call lineout 'GLOBAL.CMD', "  end"
  1133.       call lineout 'GLOBAL.CMD', "end"
  1134.       call lineout 'GLOBAL.CMD', "if arg6 \= '' then "
  1135.       call lineout 'GLOBAL.CMD', "do"
  1136.       call lineout 'GLOBAL.CMD', "  if left(arg6,1,1) \= '/' then"
  1137.       call lineout 'GLOBAL.CMD', "  do"
  1138.       call lineout 'GLOBAL.CMD', "    arg6 = stream(arg6,'c','query exists')"
  1139.       call lineout 'GLOBAL.CMD', "  end"
  1140.       call lineout 'GLOBAL.CMD', "end"
  1141.       call lineout 'GLOBAL.CMD', "if arg7 \= '' then "
  1142.       call lineout 'GLOBAL.CMD', "do"
  1143.       call lineout 'GLOBAL.CMD', "  if left(arg7,1,1) \= '/' then"
  1144.       call lineout 'GLOBAL.CMD', "  do"
  1145.       call lineout 'GLOBAL.CMD', "    arg7 = stream(arg7,'c','query exists')"
  1146.       call lineout 'GLOBAL.CMD', "  end"
  1147.       call lineout 'GLOBAL.CMD', "end"
  1148.       call lineout 'GLOBAL.CMD', "if arg8 \= '' then "
  1149.       call lineout 'GLOBAL.CMD', "do"
  1150.       call lineout 'GLOBAL.CMD', "  if left(arg8,1,1) \= '/' then"
  1151.       call lineout 'GLOBAL.CMD', "  do"
  1152.       call lineout 'GLOBAL.CMD', "    arg8 = stream(arg8,'c','query exists')"
  1153.       call lineout 'GLOBAL.CMD', "  end"
  1154.       call lineout 'GLOBAL.CMD', "end"
  1155.       call lineout 'GLOBAL.CMD', "if arg9 \= '' then "
  1156.       call lineout 'GLOBAL.CMD', "do"
  1157.       call lineout 'GLOBAL.CMD', "  if left(arg9,1,1) \= '/' then"
  1158.       call lineout 'GLOBAL.CMD', "  do"
  1159.       call lineout 'GLOBAL.CMD', "    arg9 = stream(arg9,'c','query exists')"
  1160.       call lineout 'GLOBAL.CMD', "  end"
  1161.       call lineout 'GLOBAL.CMD', "end"
  1162.       call lineout 'GLOBAL.CMD', "n = setlocal()"
  1163.       call lineout 'GLOBAL.CMD', "n = directory('"curdir"')"
  1164.       call lineout 'GLOBAL.CMD', "'start global.exe' arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  1165.       call lineout 'GLOBAL.CMD', "n = endlocal()"
  1166.       call stream 'GLOBAL.CMD','C','close'
  1167.     end
  1168.     else say "Couldn't create GLOBAL.CMD file."
  1169.     say ""
  1170.     parse upper var curdir curdir
  1171.     say "Please add the directory"
  1172.     say "  "curdir"\UTILS"
  1173.     say "to your PATH in CONFIG.SYS."
  1174.     say "┌──────────────────────────────────────────────────────────────────┐"
  1175.     say "│Remember, you'll need to reboot before such a change takes effect.│"
  1176.     say "│FM/2 will run fine from its WPS objects without this change; the  │"
  1177.     say "│proposed change allows it to be run from any command line, and for│"
  1178.     say "│other programs that might want to use FM/2 as its file manager to │"
  1179.     say "│find and run it easily.                                           │"
  1180.     say "└──────────────────────────────────────────────────────────────────┘"
  1181.     say "While you're in there, check your LIBPATH statement for a '.' entry..."
  1182.     if existed = 'EXISTED' then
  1183.     do
  1184.       say ""
  1185.       if unattended = 'UNATTENDED' then
  1186.       do
  1187.         call charout ,'  Press [Enter] for more...'
  1188.         dummy = ''
  1189.         do until dummy = '0d'x
  1190.           dummy = SysGetKey('NOECHO')
  1191.         end
  1192.         call charout ,'0d1b'x'[K'
  1193.       end
  1194.       rc = stream('fatopt.exe','c','query exists')
  1195.       say   "┌────────────────────────────────────────────────────────────────┐"
  1196.       if rc = '' then
  1197.       do
  1198.         say "│I suggest that you place the utilities from the FM/2 Utilities  │"
  1199.         say "│archive in this directory, also, in which case you should       │"
  1200.         say "│_definitely_ make the change to PATH so that FM/2 can find them.│"
  1201.       end
  1202.       say   "│You may want to tweak the command lines in the .CMD files I just│"
  1203.       say   "│built and/or those in the WPS objects in the FM/2 folder for    │"
  1204.       say   "│desired specific behaviors.  The READ.ME file will tell you how.│"
  1205.       say   "└────────────────────────────────────────────────────────────────┘"
  1206.     end
  1207.     if existed = '' then
  1208.     do
  1209.       say ''
  1210.       say "If you have previously altered your CONFIG.SYS's PATH statement"
  1211.       say 'as instructed above, please ignore this rambling.'
  1212.     end
  1213.     say ""
  1214.     if unattended = 'UNATTENDED' then
  1215.     do
  1216.       call charout ,'  Press [Enter] to continue...'
  1217.       dummy = ''
  1218.       do until dummy = '0d'x
  1219.         dummy = SysGetKey('NOECHO')
  1220.       end
  1221.       call charout ,'0d1b'x'[K'
  1222.     end
  1223.   end
  1224.   else say "Couldn't create FM2.CMD file.  Panic."
  1225.   dummy = directory(curdir)
  1226. end
  1227. else say "Couldn't switch to "curdir"\utils"
  1228.  
  1229. /* type the install.dat file to show any critical info/notices */
  1230.  
  1231. rc = stream('install.dat','c','query exists')
  1232. if rc \= '' then
  1233. do
  1234.   'type install.dat'
  1235.   'DEL INSTALL.DAT 1>NUL 2>NUL'
  1236.   if unattended = 'UNATTENDED' then
  1237.   do
  1238.     call charout ,'  Press [Enter] to continue...'
  1239.     dummy = ''
  1240.     do until dummy = '0d'x
  1241.       dummy = SysGetKey('NOECHO')
  1242.     end
  1243.     call charout ,'0d1b'x'[K'
  1244.   end
  1245. end
  1246.  
  1247. /* Final words */
  1248.  
  1249. say '┌──────────────────────────────────────────────────────────────────────────┐'
  1250. say '│To move FM/2 to another directory, move the files, delete the FM/2 folder,│'
  1251. say '│then rerun INSTALL.  There is no need to "uninstall" to move FM/2.        │'
  1252. say '│                                                                          │'
  1253. say '│To remove FM/2 completely, run UNINSTAL and follow its directions.        │'
  1254. say '└──────────────────────────────────────────────────────────────────────────┘'
  1255. say "I'm done now."
  1256. say ''
  1257.  
  1258.